package cn.kuporo.seckill.stock.domain.model.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: kuporo
 * @since: 2025/8/3
 * @description: 商品库存扣减与恢复数据
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class SeckillStockBucketDeduction {
    /**
     * 商品id
     */
    private Long goodsId;
    /**
     * 商品数量
     */
    private Integer quantity;
    /**
     * 用户id
     */
    private Long userId;
    /**
     * 分桶编号
     */
    private Integer serialNo;
    public boolean isEmpty(){
        return this.goodsId == null
                || this.quantity == null
                || this.userId == null
                || this.serialNo == null;
    }
}
